<template>
  <el-form-item label="门店名称" prop="storeName">
    <el-select
      v-model="form.storeName"
      placeholder="请输入门店名称"
      size="large"
      filterable
    >
      <el-option
        v-for="item in userStore.storeList"
        :key="item.id"
        :label="item.storeName"
        :value="item.storeName"
        @click="trigger(item)"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="门店编号" prop="storeCode">
    <el-input v-model="form.storeCode" placeholder="门店编号" />
  </el-form-item>
  <el-form-item label="品牌" prop="brand">
    <el-input v-model="form.brand" placeholder="品牌" />
  </el-form-item>
</template>
<script setup>
import { computed, ref } from "vue";
import useUserStore from "@/store/modules/user";
import { number } from "echarts";
const userStore = useUserStore();
userStore.getStoreList();
const props = defineProps({
  form: {
    typeof: Object,
    default: {},
  },
});
const emits = defineEmits(["update:form"]);
const form = computed({
  get(a) {
    return props.form;
  },
  set(a) {
    emits('update:form',a)
  },
});
const trigger = (data) => {
    form.value.storeName=data.storeName
    form.value.storeCode=data.storeCode
    form.value.storeId=data.id
    form.value.brand=data.brand
};
</script>
<style scoped>
</style>